import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import './hastreat.css'
import { AtSteps,AtRadio,AtInput, AtForm,AtButton,AtCheckbox } from 'taro-ui'
import {$redirectTo} from '../../../global'
import app from '../../../main.js'
export default class HasTreat extends Component {

  config = {
    navigationBarTitleText: '快速问诊'
  }
  constructor () {
    super(...arguments)
    this.state = {
      current: 1,
      value: '',
      val:'',
      checkedList: ['list1']
    }
    this.checkboxOption = [{
      value: 'list1',
      label: '尚未确诊'
    }]
  }
  
  onChange (current) {
    this.setState({
      current
    })
  }
  handleChange (value) {
    this.setState({
      value,
      checkedList: value
    })
  }
wenti=()=>{
  app.redirectTo("../hasmedicine/hasmedicine")
}
  componentWillMount () { }

  componentDidMount () { }

  componentWillUnmount () { }

  componentDidShow () { }

  componentDidHide () { }

  render () {
    const items = [
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' }
        
      ];
    return (
      <View className='has-treat'>
         <AtSteps
        className='steps'
        items={items}
        current={this.state.current}
        onChange={this.onChange.bind(this)}
      />
      <View className='title'>本次咨询的疾病有去过医院就诊吗？</View>
      <AtRadio
        options={[
          { label: '有', value: 'option1' },
          { label: '没有', value: 'option2' },
        ]}
        value={this.state.value}
        onClick={this.handleChange.bind(this)}
      />
      <AtForm>
      <AtInput
        name='value'
        title='就诊过的医院'
        type='text'
        placeholder='请输入医院名称'
        value={this.state.val}
        onChange={this.handleChange.bind(this)}
      />
      <AtInput
        name='value'
        title='就诊过的科室'
        type='text'
        placeholder='请输入科室名称'
        value={this.state.val}
        onChange={this.handleChange.bind(this)}
      />
      <AtInput
        name='value'
        title='确诊疾病为'
        type='text'
        placeholder='请输入疾病名称'
        value={this.state.val}
        onChange={this.handleChange.bind(this)}
      />
      </AtForm>
      <View className='tips'>如未确诊，请勿输入疾病名称</View>
      <View className='btn-box' onClick={this.wenti}><AtButton className='next-btn' full>下一步</AtButton></View>
      </View>
    )
  }
}

